package com.test.spring.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.test.spring.bean.User;
import com.test.spring.mapper.UserMapper;
import com.test.spring.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserMapper userMapper;
	
	/**
	 * 获取用户列表
	 */
	@Override
	public void getUserList() {
		
		System.out.println("走 从数据库");
		
		List<User> listUser = userMapper.getUserList();
		System.out.println(listUser);
		
		System.out.println("================");
	}

	/**
	 * 更新用户信息
	 */
	@Override
	public void updateUser(String userId,String userName) throws Exception{
		System.out.println("走 主数据库");
		int sucess = userMapper.updateUser(userId, userName);
		System.out.println(sucess);
		throw new RuntimeException();
	}
}
